import { ClassfootEntity } from './classtify';
import { xsEntity } from './commentity';
import { Column, Entity, ManyToOne, OneToMany } from 'typeorm';
import { FoodEntity } from './food';
import { ShopclassEntity } from './shopclass';
import { OrderEntity } from './order';

/**
 * 描述
 */
@Entity()
export class ShopEntity extends xsEntity {
    @Column({ comment: '店铺名称' })
    name: string;

    @Column({ comment: '头像' })
    img: string;
    @Column({ comment: '封面    ' })
    cover: string;
    @Column({ comment: '销量' })
    sell: number;
    @Column({ comment: '评分' })
    start: number;
    @Column({ comment: '起送费' })
    express: string;
    @Column({ comment: '经度', default: null })
    longitude: string;
    @Column({ comment: '纬度', default: null })
    latitude: string;

    @OneToMany(type => ClassfootEntity, photo => photo.shopid) // note: we will create author property in the Photo class below
    shopfoodsclassify: ClassfootEntity[];
    @OneToMany(type => FoodEntity, photo => photo.shopPid) // note: we will create author property in the Photo class below
    shopfoods: FoodEntity[];


    @ManyToOne(type => ShopclassEntity, author => author.shop)
    shopclass: ShopclassEntity;
    @OneToMany(type => OrderEntity, author => author.shop)
    order: OrderEntity;






}
